package cn.example.demo.modules.house.dto;

import cn.example.demo.common.retrieval.BaseRequest;
import cn.example.demo.common.validation.groups.Delete;
import cn.example.demo.common.validation.groups.Insert;
import cn.example.demo.common.validation.groups.Update;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 描述：【推荐结果】DTO
 */
@JsonIgnoreProperties(ignoreUnknown = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RecommendResultDto extends BaseRequest implements Serializable {
    private static final long serialVersionUID = 1L;

    @NotBlank(message = "ID不能为空！", groups = {Update.class})
    private String id;

    @NotNull(message = "用户ID不能为空！", groups = {Insert.class, Update.class})
    private Integer userId;

    @NotNull(message = "推荐房源ID列表不能为空！", groups = {Insert.class, Update.class})
    private String recommendedIds;

    private String algorithmVersion;

    private String generateStrategy;

    private Integer organizationId;

    private Integer createUser;

    private String createUserName;

    private Date createTime;

    private Integer updateUser;

    private String updateUserName;

    private Date updateTime;

    private Date createTimeStart;
    private Date createTimeEnd;
    private Date updateTimeStart;
    private Date updateTimeEnd;

    @NotEmpty(message = "IDs不能为空集！", groups = {Delete.class})
    private List<String> ids;

    public RecommendResultDto(Integer userId, String recommendedIds, String algorithmVersion, String generateStrategy) {
        this.userId = userId;
        this.recommendedIds = recommendedIds;
        this.algorithmVersion = algorithmVersion;
        this.generateStrategy = generateStrategy;
    }
}
